using  Business.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;

namespace  Business.Permissions
{
    public class  BusinessPermissionDefinitionProvider: PermissionDefinitionProvider
    {

        public override void Define(IPermissionDefinitionContext context)
        {
            var  Business = context.AddGroup( BusinessPermissions. Business, L(" Business"), MultiTenancySides.Both);

            var OrderLiveWareOUT =  Business.AddPermission( BusinessPermissions.OrderLiveWareOUT.Default, L("OrderLiveWareOUT"));
            OrderLiveWareOUT.AddChild( BusinessPermissions.OrderLiveWareOUT.Update, L("Edit"));
            OrderLiveWareOUT.AddChild( BusinessPermissions.OrderLiveWareOUT.Delete, L("Delete"));
            OrderLiveWareOUT.AddChild( BusinessPermissions.OrderLiveWareOUT.Create, L("Create"));

            //Code generation...
        }

        private static LocalizableString L(string name)
        {
            return LocalizableString.Create< BusinessResource>(name);
        }
    }
}
